<?php $route_column = isset($this->params['route_column']) ? $this->params['route_column'] : 'id' ?>
	public function executeBatchVersion(sfWebRequest $request)
	{
		$request->checkCSRFProtection();

		$id = $request->getParameter('<?php echo $route_column ?>');

		if (!$versions = $request->getParameter('versions'))
		{
			$this->getUser()->setFlash('error', 'Debe seleccionar al menos una versión.');

			$this->redirect('@<?php echo $this->getUrlForAction('historic?'),$route_column ?>=' . $id);
		}

		if (!$action = $request->getParameter('batch_action'))
		{
			$this->getUser()->setFlash('error', 'Seleccione la acción que quiera ejecutar sobre las versiones seleccionadas.');

			$this->redirect('@<?php echo $this->getUrlForAction('historic?'),$route_column ?>=' . $id);
		}

		if (!$this->getUser()->hasCredential($this->configuration->getCredentials($action)))
		{
			$this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
		}

		try
		{
			$method = 'execute' . ucfirst($action);
			$this->$method($request);
		}
		catch (Exception $e)
		{
			$this->getUser()->setFlash('error', 'Se ha producido un error al realizar la acción seleccionada.');
			$this->logError($e->getMessage());
		}

		$this->redirect('@<?php echo $this->getUrlForAction('historic?'),$route_column ?>=' . $id);
	}

	public function executeBatchDeleteVersion(sfWebRequest $request)
	{
		$request->checkCSRFProtection();

		$versions = $request->getParameter('versions');
		$id = $request->getParameter('<?php echo $route_column ?>');

		$table = AuditoriaEntidadTable::getInstance();

		try
		{
			$table->deleteVersions('<?php echo $this->getModelClass() ?>', '<?php echo $route_column ?>', $id, $versions);
			$this->getUser()->setFlash('notice', 'Las versiones seleccionadas se han eliminado correctamente.');
		}
		catch (Exception $e)
		{
			$this->getUser()->setFlash('error', 'Se ha producido un error al borrar las versiones seleccionadas.');
		}

		$this->redirect('@<?php echo $this->getUrlForAction('historic?'),$route_column ?>=' . $id);
	}
